﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyTruongMamNon.Man_Hinh
{
    public partial class frmLop : Form
    {
        public frmLop()
        {
            InitializeComponent();
        }


        public void HienThiKhoi()
        {
            string sql = "select * from KHOI";
            DataTable dt = new DataTable();
            dt = Thu_Vien.ExecuteQuery(sql);

            cboKhoi.DataSource = dt;
            cboKhoi.DisplayMember = "Tenkhoi";
            cboKhoi.ValueMember = "Makhoi";
        }
        public void HienThiLop()
        {
            string sql = "select * from LOP";
            DataTable dt = new DataTable();
            dt=Thu_Vien.ExecuteQuery(sql);

            dtgLp.DataSource = dt;

            txtMalop.DataBindings.Add("text", dt, "Malop");
            txtTenLop.DataBindings.Add("text", dt, "Tenlop");
            cboKhoi.DataBindings.Add("text", dt, "Makhoi");
        }

        private void frmLop_Load(object sender, EventArgs e)
        {
            HienThiKhoi();
            HienThiLop();
        }   

       
    }
}
